﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using System.Globalization;
using Microsoft.SharePoint.Utilities;
using System.Collections;

namespace Rtl.SharePoint.WebControls
{
    public class VEAddressPicker : PickerDialog
    {
        public VEAddressPicker() : base(new VEAddressLookupQueryControl(), new TableResultControl(), new VEAddressEditor() ) { }

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            /* headings, data bindings, and column widths - must be same in size, column settings share
             * the same index between all three arrayLists */

            // create an array of row headings shown in picker results list
            ArrayList columnDisplayNames = ((TableResultControl)base.ResultControl).ColumnDisplayNames;
            columnDisplayNames.Clear();
            columnDisplayNames.Add("Address");

            // names of fields in bound datasource
            ArrayList columnNames = ((TableResultControl)base.ResultControl).ColumnNames;
            columnNames.Clear();
            columnNames.Add("Formatted");

            // widths of columns in picker dialog
            ArrayList columnWidths = ((TableResultControl)base.ResultControl).ColumnWidths;
            columnWidths.Clear();
            columnWidths.Add("100%");
        }
    }
}
